using System;
using System.IO;
namespace Yahtzee.Game
{
    public abstract class Scorecombinatie
    {

        protected Beurt beurt;

        public abstract int getScore();

        public bool isVrij()
        {
            return beurt == null;
        }

        public void setBeurt(Beurt beurt)
        {
            if (this.beurt != null)
            {
                throw new InvalidOperationException();
            }
            this.beurt = beurt;
        }

        public override String ToString()
        {
            return this.GetType().Name;
        }

        public void write(TextWriter output)
        {
            output.Write("   ");
            output.Write("{0, 18}", this.ToString());
            output.Write(": ");
            output.Write("{0, 3}", getScore());
            output.Write(" ");
            output.Write(" [");
            foreach (int aantal in this.beurt.geefOgen())
            {
                output.Write(aantal + " ");
            }
            output.WriteLine("]");
        }
    }
}